/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.com.cotelasa.scp.controlador.converter;

import javax.faces.convert.Converter;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.FacesConverter;
import org.springframework.stereotype.Component;

/**
 *
 * @author Esparza
 */
@FacesConverter(value = "modoEnvioConverter")
@Component("modoEnvioConverter")

public class ModoEnvioConverter implements Converter{

    @Override
    public Object getAsObject(FacesContext fc, UIComponent uic, String modoEnvio) {
        try {
            return modoEnvio;
            //return servicioCategoriaArticulo.obtenerCategoriaArticuloPorNombre(categoriaArticulo);
        } catch (Exception e) {
            return null;
        }
        
    }

    @Override
    public String getAsString(FacesContext fc, UIComponent uic, Object o) {
        if (o != null) {
            return ((String) o);
            //return ((CategoriaArticulo)o).getNombre();
        }
        return "";
    }
    
}
